
from time import sleep

from appium import webdriver
from selenium.webdriver.common.by import By
# desired_capabilities = {
#     'platformName':'Android',
#     'deviceName':'127.0.0.1:62001',
#     'platformVersion':'7.1.2',
#     'appPackage':'com.gfeng.daydaycook',
#     'appActivity':'com.gfeng.daydaycook.activity.WelcomeActivity',
#     'noReset':True,         #启动不被重置
#     'newCommandTimeout':60,   #等待超时时间
#     'unicodekeyboard':True,     #输入法支持中文
#     'resetKeyboard':True        #重置输入法到原有状态
# }
# driver = webdriver.Remote("http://localhost:4723/wd/hub",desired_capabilities)
# sleep(5)
from page.base_page import BasePage
class Foucus(BasePage):
    def ele_foucus(self,driver):
        self.driver=driver
    def ele_commum(self):
        # 进入社区
        self.driver.tap([(325, 1850), (325, 1850)], 500)
        sleep(4)
    def ele_remain(self):
        #进入热门主厨
        self.driver.tap([(120,700),(120,700)],500)
        sleep(8)
    def ele_menu(self):
        #进入菜品页
        self.driver.tap([(350,950),(350,950)],500)
        sleep(4)
    def ele_foucus_btn(self):
        #点击关注
        self.driver.tap([(1000,1300),(1000,1300)],500)
        sleep(3)
    def ele_return(self):
        #返回
        self.driver.tap([(50,96),(50,96)],500)
        sleep(3)
        self.driver.tap([(50,96),(50,96)],500)
        sleep(3)
    def ele_my(self):
        #进入我的查看
        self.driver.tap([(970,1870),(970,1870)],500)
        #进入我的关注查看
    def ele_myfoucus(self):
        sleep(5)
        self.driver.tap([(40,478),(40,478)],500)

    def look_all(self):
        self.ele_commum()
        self.ele_remain()
        self.ele_menu()
        self.ele_foucus_btn()
        self.ele_return()
        self.ele_my()
        self.ele_myfoucus()
